package com.hliushi.mp.config;

import com.hliushi.mp.entity.User;
import com.hliushi.mp.service.UserService;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName TestConfiguration
 * @Description TODO
 * @Author hliushi
 * @Date 2021/9/2 15:05
 * @Version V1.0
 **/
@Configuration
public class TestConfiguration {


    @Bean("user01")
    public User user01(@Qualifier("userServiceImpl") UserService userService) {
        userService.printSource();
        return User.builder()
                .userName("llhuang10")
                .addr("anhui")
                .mail("hliushi@foxmail.com")
                .build();
    }

    @Bean("user02")
    public User user02(@Qualifier("userServiceImpl02") UserService userService) {
        userService.printSource();
        return User.builder()
                .userName("hliushi")
                .addr("shanghai")
                .mail("hliushi@foxmail.com")
                .build();
    }
}
